import { ChangeDetectionStrategy, Component, Input, OnInit, TemplateRef, ViewEncapsulation } from '@angular/core';
import { TypeUtils } from '../core/utils/api';
import { I18NService } from '../core/i18n/api';

@Component({
  selector: 'lv-empty',
  exportAs: 'lvEmpty',
  templateUrl: './empty.component.html',
  encapsulation: ViewEncapsulation.None,
  changeDetection: ChangeDetectionStrategy.OnPush,
  host: {
    class: 'lv-empty',
    '[class.lv-empty-description-only]': '!lvImage',
  },
})
export class EmptyComponent implements OnInit {
  @Input() lvImageClass: string;

  @Input() lvImage: string | TemplateRef<void> | null = 'lv-icon-no-data'; // NEED_DO: string类型暂只支持icon id，后续根据需求拓展

  @Input() lvDescription: string | TemplateRef<void> | null = this.i18n.get('emptyData');

  public typeUtils = TypeUtils;

  constructor(public i18n: I18NService) {}

  ngOnInit(): void {}
}
